package com.bbm.communitysystem.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.bbm.communitysystem.domain.ChatHistory;
import com.bbm.communitysystem.domain.dto.chat.ChatHistoryDto;
import com.bbm.communitysystem.mapper.ChatHistoryMapper;
import com.bbm.communitysystem.service.IChatHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bbm
 * @since 2025-03-01
 */
@Service
public class ChatHistoryServiceImpl extends ServiceImpl<ChatHistoryMapper, ChatHistory> implements IChatHistoryService {

    @Override
    public void addChatHistory(ChatHistoryDto chatHistory) {

        ChatHistory chatHistory1 = BeanUtil.copyProperties(chatHistory, ChatHistory.class);

        chatHistory1.setCreateTime(System.currentTimeMillis() + "");

        boolean save = save(chatHistory1);

    }

    @Override
    public Integer delChatHistory(Integer id) {
        return null;
    }

    @Override
    public Integer updateChatHistory(ChatHistoryDto chatHistory) {
        return null;
    }
}
